package com.gopay.common.gateway.dao.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.fund.FundGopayGenOrderTransDtl;
import com.gopay.common.domain.pg.PgP2pOrderTransDtl;
import com.gopay.common.gateway.dao.PgFundOrderTransDtlQueryDAO;
import com.gopay.common.gateway.dao.PgP2pOrderTransDtlQueryDAO;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("pgFundOrderTransDtlQueryDAO")
public class PgFundOrderTransDtlQueryDAOImpl extends BaseDAOImpl<FundGopayGenOrderTransDtl, Serializable> implements
        PgFundOrderTransDtlQueryDAO {
    @Override
    public FundGopayGenOrderTransDtl getEntity(int id) {

        StringBuffer sql = new StringBuffer("from FundGopayGenOrderTransDtl where transDtlSq=:id");
        Map<String, Object> map = new HashMap<String, Object>();
            map.put("id", id);
        List<FundGopayGenOrderTransDtl> byHql = findByHql(sql.toString(), map);
        if (byHql.size() > 0) {
            FundGopayGenOrderTransDtl fundGopayGenOrderTransDtl = byHql.get(0);
            return fundGopayGenOrderTransDtl;
        }
        return null;
    }


}
